package com.niguang.work.labour.api.service.impl;

import com.niguang.work.labour.api.service.YmyfFaceService;
import com.niguang.work.labour.api.vo.SynMemberResultVo;
import com.niguang.work.labour.api.vo.SynchroMembersVo;
import com.niguang.work.labour.common.pojo.Result;
import com.niguang.work.labour.common.util.HttpClientUtil;
import com.niguang.work.labour.common.util.XmlUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class YmyfFaceImpl implements YmyfFaceService {
    /**
     * 链接  TelpoFace平台 地址
     */
    private static final String SYN_MEMBER_URL = "http://123.207.254.37/WCUCenterCord/service/i_gongde_757_service/i_gongde_757_service_v01_34_235.aspx";

    @Override
    public SynMemberResultVo synMembers(SynchroMembersVo synchroMembersVo) {
        String postXml = HttpClientUtil.postXml(SYN_MEMBER_URL, synchroMembersVo);
        log.info("开始同步新版人员信息：{}", synchroMembersVo);
        SynMemberResultVo synMemberResultVo = XmlUtils.xmlToBean(SynMemberResultVo.class, postXml);
        log.info("同步员工返回信息：{}", synMemberResultVo);
        return synMemberResultVo;
    }

    @Override
    public Result synMembersBySiteId(Long siteId) {
        return null;
    }

    @Override
    public Result getVisitorYmyl(Long siteId) {
        return null;
    }
}
